<!--
 * @Author: 孙开源 && sunkaiyuan@namenode.cn
 * @Date: 2023-05-05 21:24:13
 * @LastEditors: 孙开源 && sunkaiyuan@namenode.cn
 * @LastEditTime: 2023-07-26 15:58:14
 * @Description: 
 * 
-->
<template>
	<el-tabs @tab-change="tabchange" :style="'height:' + autoheight">
		<slot></slot>
	</el-tabs>
</template>

<script>
export default {
	emits: ["tab-change"],
	data() {
		return {
			autoheight: "auto",
		};
	},
	methods: {
		tabchange(index) {
			if (index != 0) this.autoheight = this.$el.offsetHeight + "px";
			this.$emit("tab-change", index);
		},
	},
};
</script>
<style>
.el-tabs__content {
	height: calc(100% - 26px);
}

.el-tab-pane {
	height: 100%;
}
</style>
